package com.example.test.applicaiton.services.imp;

import com.example.test.applicaiton.services.ArticleService;
import com.example.test.domain.entity.ArticleModel;
import com.example.test.domain.mapper.ArticleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {
    @Resource
    private ArticleMapper articleMapper;

    public List<ArticleModel> selectAll(String title, String categoryName) {
        return articleMapper.selectAll(title, categoryName);
    }

    public int addArticle(ArticleModel articleModel) {
        return articleMapper.addArticle(articleModel);
    }

    public int deleteArticleById(long id) {
        return articleMapper.deleteArticleById(id);
    }

    public int updateArticleById(ArticleModel articleModel) {
        return articleMapper.updateArticleById(articleModel);
    }
}

